<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('虚户列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label style="width: 100px;">商户号：</label>
                            <input type="text" name="merNo"/>
                        </li>
                        <li>
                            <label style="width: 100px;">账户状态：</label>
                            <select name="status">
                                <option value="">所有</option>
                                <option value="1">启用</option>
                                <option value="0">未启用</option>
                            </select>
                        </li>
                        <li>
                            <label style="width: 10px;"></label>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <!--  <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="accounts:virtualAccount:add">
                  <i class="fa fa-plus"></i> 添加
              </a>-->
            <a class="btn btn-primary single disabled" onclick="$.operate.edit(null,'350','800')" shiro:hasPermission="accounts:virtualAccount:edit">
                <i class="fa fa-edit"></i> 提现
            </a>
            <!--  <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="accounts:virtualAccount:remove">
                  <i class="fa fa-remove"></i> 删除
              </a>
              <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="accounts:virtualAccount:export">
                  <i class="fa fa-download"></i> 导出
              </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" class="table text-nowrap"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('accounts:virtualAccount:edit')}]];
    var removeFlag = [[${@permission.hasPermi('accounts:virtualAccount:remove')}]];
    var prefix = ctx + "accounts/virtualAccount";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "虚户",
            firstLoad:true,
            clickToSelect:true,
            columns: [{
                radio: true
            },
                {
                    field: 'id',
                    title: 'pk_id',
                    visible: false
                },
                {
                    field: 'merNo',
                    title: '商户号'
                },
                {
                    field: 'usableBalance',
                    title: '可用余额'
                },
                {
                    field: 'usableBalanceB',
                    title: '北京余额'
                },
                {
                    field: 'lastUpdateDate',
                    title: '最后更新时间(上海)',
                    formatter:function(value,row,index){
                        return value + " " + row.lastUpdateTime;
                    }
                },
                {
                    field: 'lastUpdateDateB',
                    title: '最后更新时间(北京)',
                    formatter:function(value,row,index){
                        return value + " " + row.lastUpdateTimeB;
                    }
                },
                {
                    field: 'status',
                    title: '账户状态',
                    formatter:function(value,row,index){
                        if (value == '0'){
                            return "<span style='color: red'>未启用</span>";
                        } else if (value == '1'){
                            return "<span style='color: green'>启用</span>";
                        } else {
                            return "未知";
                        }
                    }
                },
                /* {
                     title: '操作',
                     align: 'center',
                     formatter: function(value, row, index) {
                         var actions = [];
                         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }
                 }*/]
        };
        $.table.init(options);
    });
</script>
</body>
</html>